home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
clang
/
tcplusx.zip
/
DEVICE.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1991-02-28
|
3KB
|
131 lines
//
// device.cpp - implementation for class Device
// Author - Robin W. McKean
// Last Update - February 19,1991
// Copyright (C) 1991 All rights reserved
//
// This file remains the property of the author, Robin W. McKean. You are
// free to use and change it as you see fit. This module, nor its object
// code, may not however be included in any packaged software without the
// written consent of the author.
//
// Contents ----------------------------------------------------------------
//
// Device::Device
// Device::isEqual
// Device::printOn
//
// Description
//
// Defines the class Device. The purpose of this class is to input
// information from a device and translate it into events. This is
// an abstract class from which other device types are made.
//
// End ---------------------------------------------------------------------
// Interface dependencies --------------------------------------------------
#ifndef _IOSTREAM_H
#include <iostream.h>
#endif
#ifndef _USETYPES_H
#include <usetypes.h>
#endif
#ifndef _GEN_H
#include <gen.h>
#endif
#ifndef _EVENT_H
#include <event.h>
#endif
#ifndef _DEVICE_H
#include <device.h>
#endif
// End Interface dependencies ----------------------------------------------
// Member Function //
Device::Device( int initStatus )
// Summary ------------------------------------------------------------------
//
// Sets the initial status of the device
//
// End ---------------------------------------------------------------------
{
status = initStatus;
}
// End Device::Device //
// Member Function //
Device::Device( Device& theDevice )
// Description -------------------------------------------------------------
//
// Copies one device into another
//
// Parameters
//
// Device&
//
// The device to be copied
//
// End ---------------------------------------------------------------------
{
status = theDevice.status;
}
// End Device::Device( Device& ) //
// Member Function //
hashValueType Device::hashValue( ) const
// Description -------------------------------------------------------------
//
// Returns a hash value representation of a class, in this case, there
// is none, so we return 0.
//
// End ---------------------------------------------------------------------
{
return hashValueType( 0 );
}
// End Device::hashValue //
int Device::isEqual( const Object& theDevice ) const
// Description -------------------------------------------------------------
//
// Returns a 1 if this object is equal to the event
//
// End ---------------------------------------------------------------------
{
return( isA() == theDevice.isA() && status == ( ( Device& )theDevice ).status );
}
// End Device::isEqual //
// Member Function //
void Device::printOn( ostream& outputStream ) const
// Description -------------------------------------------------------------
//
// Prints the contents of this object to the outputStream
//
// End ---------------------------------------------------------------------
{
outputStream << nameOf() << " " << "Status: " << status;
}
// End Device::printOn //